/*
 * Copyright Thoughtworks, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Forms.css
 */

/**
 * TABLE OF CONTENTS
 *
 * =FORM_ERRORS
 * =REQUIRED_MESSAGING
 * =TRISTATE_CHECKBOX
 * =FORM_ITEM_PROPERTIES
 * =! NEEDS TO BE MIGRATED
**/

/**
 * =FORM_ERRORS
**/

label.error {
  float: left;
  color: #a40000;
  width: auto;
  max-width: 370px;
  padding-left: 8px;
  font-style: italic;
}

.form_error {
  color: #a40000;
  float: left;
  font-style: italic;
  max-width: 370px;
  padding: 7px;
  width: auto;
}

textarea.error,
input[type="text"].error,
.fieldWithErrors textarea,
.fieldWithErrors textarea:focus,
.fieldWithErrors input[type="text"],
.fieldWithErrors select,
.fieldWithErrors input[type="text"]:focus,
.field_with_errors textarea,
.field_with_errors textarea:focus,
.field_with_errors input[type="text"],
.field_with_errors select,
.field_with_errors input[type="text"]:focus {
  background-color: #f6e0e0;
  border: 1px solid #da7272;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 20%);
  float: left;
}

.fieldset .error,
.fieldWithErrors label,
.field_with_errors label {
  color: #a40000;
}

/**
 * =REQUIRED_MESSAGING
**/
.required .asterisk {
  color: #c00;
}

/**
 * =FORM_ITEM_PROPERTIES
**/

.form_item.disabled input {
  background-color: #d0d0d0;
}

.form_item.disabled label,
.form_item.disabled h3 {
  color: #999;
}

/**
 * =! NEEDS TO BE MIGRATED
**/

label.inline {
  display: inline;
  margin-bottom: 0;
  vertical-align: top;
}

.form_item {
  margin-bottom: 10px;
}

.form_item button {
  margin-left: 5px;
}

.form_item_block {
  padding-bottom: 15px;

  &.with-padding-top {
    padding-top: 15px;
  }
}

.form_item_block:last-child {
  padding-bottom: 0;
}

.fieldset,
fieldset {
  border-radius: 5px 5px 5px 5px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 15%) inset;
  background-color: #eee;
  border: 1px solid #ccc;
  clear: both;
  margin: 0 0 0;
  padding: 15px 15px;
}

.fieldset.has_nested_fieldset .fieldset {
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.nested_form_fragment .fieldset,
.nested_form_fragment fieldset {
  border: none;
  clear: both;
  margin: 0 0 0;
  padding: 0;
}

.fieldset {
  clear: none;
  margin-bottom: 15px;
}

.fieldset .form_item_block input,
.fieldset .form_item_block select {
  float: left;
}

.fieldset .form_item_block input[type="radio"],
.fieldset .form_item_block input[type="checkbox"] {
  float: none;
}

.form_item {
  margin: 0;
  padding-bottom: 20px;
  overflow: hidden;
}

.fieldset .form_item {
  padding-bottom: 10px;
  border-bottom: 1px dotted #ccc;
  margin-bottom: 10px;
}

.fieldset .form_item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border: 0;
}

.form_item_block {
  margin-right: 10px;
}

.form_buttons {
  overflow: hidden;
}

.form_item_block {
  margin-right: 10px;
  overflow: hidden;
  border-radius: 5px;
}

textarea.template {
  display: none;
}

select.large,
textarea.large,
input.large {
  width: 500px;
}

input.small {
  width: 100px;
}

input.extra_small {
  width: 50px;
}

select.small {
  width: 125px;
}

input.full {
  width: 100%;
}

label.disabled {
  color: #999;
}

input.in_between_text {
  margin-left: -9px;
}
